using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableApproveStatus
	{
		public const string Table = "ApproveStatus";
		public const string ApproveStatusID = "ApproveStatusID";
		public const string ApproveStatusName = "ApproveStatusName";
	}
	
	[Serializable]
	public class BaseApproveStatus
		: IDbSessionEntity, IJsonClass
	{
		int m_ApproveStatusID;
		/// <summary>
        /// 审批状态表ID(主键)
        /// </summary>
        public int ApproveStatusID
        {
            get { return m_ApproveStatusID; }
            set { m_ApproveStatusID = value; }
        }
		
		string m_ApproveStatusName;
		/// <summary>
        /// 审批状态名称(未审核,审核通过,审核未通过)
        /// </summary>
        public string ApproveStatusName
        {
            get { return m_ApproveStatusName; }
            set { m_ApproveStatusName = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ApproveStatusID = reader[TableApproveStatus.ApproveStatusID];
            m_ApproveStatusName = reader[TableApproveStatus.ApproveStatusName];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableApproveStatus.ApproveStatusID, PrimaryKeyType.Identity, ApproveStatusID);
			writer[TableApproveStatus.ApproveStatusName] = ApproveStatusName;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ApproveStatusID = idd;
        }
		
		public string TableName
        {
            get { return TableApproveStatus.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ApproveStatusID = hashToRead["ApproveStatusID"];
			 
             m_ApproveStatusName = hashToRead["ApproveStatusName"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ApproveStatusID"] = ApproveStatusID;
			 
            hashToFill["ApproveStatusName"] = ApproveStatusName;
			 
        }

        #endregion
		
	}
}
